export default class SLKCommon {
    static getUnitMissileart(u: unit) {
        let id = id2string(GetUnitTypeId(u));
        return _g_objs.unit[id]?.Missileart ?? _g_objs.unit[id]?.Missileart_1 ?? 'Abilities\\Weapons\\Arrow\\ArrowMissile.mdl';
    }
    static getUnitMissileSpeed(u: unit) {
        let id = id2string(GetUnitTypeId(u));
        return _g_objs.unit[id]?.Missilespeed ?? _g_objs.unit[id]?.Missilespeed_1 ?? 600;
    }
    static getUnitMissilearc(u: unit) {
        let id = id2string(GetUnitTypeId(u));
        return _g_objs.unit[id]?.Missilearc ?? _g_objs.unit[id]?.Missilearc_1 ?? 0;
    }
    static getUnitModel(u: unit) {
        let id = id2string(GetUnitTypeId(u));
        let perfix = _g_objs.unit[id].file;
        if (perfix.includes('.mdl') || perfix.includes('.mdx')) return perfix;
        return perfix + '.mdx';
    }
    /**
     * 判断单位是否是近战单位
     * @param u 单位
     */
    static isUnitMetal(u: unit) {
        let id = id2string(GetUnitTypeId(u));
        return _g_objs.unit[id]?.weapTp1 == 'normal';
    }
}
